<template>
	<modal :showModal="showModal">
		<view class="dialog-modal" id='dialog-modal' :class="[showModal ? 'show':'']">
			<view class="title">提示</view>
			<view class="con">{{text}}</view>
			<view class="btn-wrap">
				<view class="btn cancel line_center" @tap='cancel'>我再想想</view>
				<view class="btn sure line_center" @tap='sure'>确定</view>
			</view>
		</view>
	</modal>
	
</template>

<script>
	import modal from '../modal/modal.vue';
	export default {
		name:"dialog-modal",
		components:{
			modal,
		},
		props:{
			showModal:Boolean,
			text:{
				type:String,
				default:"确定退出登录吗？"
			}
		},
		data() {
			return {
				
			};
		},
		methods:{
			cancel(){
				this.$emit('cancel')
			},
			sure(){
				this.$emit('sure')
			}
		}
	}
</script>

<style lang="scss" scoped>
	.dialog-modal{
		width:500rpx;
		height: 260rpx;
		background: #fff;
		border-radius: 10rpx;
		position: fixed;
		left:0;
		right:0;
		bottom:0;
		top:0;
		margin:auto;
		opacity: 0;
		transition: all 0.5s ease-in-out;
	}
	.show{
		opacity: 1;
	}
	.title{
		font-size: 30rpx;
		font-weight: bold;
		text-align: center;
		padding-top:30rpx;
	}
	.con{
		color:#707070;
		text-align: center;
		padding-top:10rpx;
	}
	.btn-wrap{
		display: flex;
		justify-content: space-between;
		margin:60rpx 60rpx;
		.btn{
			width:160rpx;
			border-radius: 10rpx;
			height:60rpx;
			box-sizing: border-box;
		}
		.cancel{
			border:2rpx solid $dis-font-color;
			margin-right: 30rpx;
			color:$dis-font-color;
		}
		.sure{
			background: $dis-font-color;
			color:#fff
		}
	}

</style>